package Vue.Principale;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.IOException;
import java.util.Observable;
import java.util.Observer;

import javax.imageio.ImageIO;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;

import LookAndFeel.Bouton;

public class Action extends JPanel implements Observer{

	private static final long serialVersionUID = 1L;
	private Box contenu, action;
	private JPanel perso, action1, action2, chateau;


	public Action() {
		this.setBackground(new Color(69, 53, 40));
		this.setLayout(new BorderLayout());
		contenu = new Box(BoxLayout.X_AXIS);
		
		perso = new JPanel(new GridLayout(5, 1));
		perso.setPreferredSize(new Dimension(80, 200));
		perso.setBackground(new Color(69, 53, 40));
		action1 = new JPanel(new GridLayout(2, 2));
		action1.setPreferredSize(new Dimension(112, 65));
		action1.setBackground(new Color(69, 53, 40));
		action2 = new JPanel(new GridLayout(4, 1));
		action2.setPreferredSize(new Dimension(112, 120));
		action2.setBackground(new Color(69, 53, 40));
		action = new Box(BoxLayout.Y_AXIS);		
		chateau = new JPanel(new GridLayout(5, 1));
		chateau.setPreferredSize(new Dimension(80, 200));
		chateau.setBackground(new Color(69, 53, 40));
		
		/*Chargement des images*/
	    perso.add(new JLabel(new ImageIcon("./src/Images/Menu/perso.PNG")));
	    perso.add(new JLabel(new ImageIcon("./src/Images/Menu/perso.PNG")));
	    perso.add(new JLabel(new ImageIcon("./src/Images/Menu/perso.PNG")));
	    perso.add(new JLabel(new ImageIcon("./src/Images/Menu/perso.PNG")));
	    perso.add(new JLabel(new ImageIcon("./src/Images/Menu/perso.PNG")));
	    
	    chateau.add(new JLabel(new ImageIcon("./src/Images/Menu/perso.PNG")));
	    chateau.add(new JLabel(new ImageIcon("./src/Images/Menu/perso.PNG")));
	    chateau.add(new JLabel(new ImageIcon("./src/Images/Menu/perso.PNG")));
	    chateau.add(new JLabel(new ImageIcon("./src/Images/Menu/perso.PNG")));
	    chateau.add(new JLabel(new ImageIcon("./src/Images/Menu/perso.PNG")));
	    
	    Bouton b1 = new Bouton("./src/Images/Menu/action.PNG");
	    b1.addActionListener(new ActionListener() {			
			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				
			}
		});
	    Bouton b2 = new Bouton("./src/Images/Menu/action.PNG");
	    b2.addActionListener(new ActionListener() {			
			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				
			}
		});	
	    Bouton b3 = new Bouton("./src/Images/Menu/action.PNG");
	    b3.addActionListener(new ActionListener() {			
			@Override
			public void actionPerformed(ActionEvent e) {
				
			}
		});	
	    Bouton b4 = new Bouton("./src/Images/Menu/action.PNG");
	    b4.addActionListener(new ActionListener() {			
			@Override
			public void actionPerformed(ActionEvent e) {
				
			}
		});		    
	    action1.add(b1);
	    action1.add(b2);
	    action1.add(b3);
	    action1.add(b4);
	    
	    Bouton passerTour = new Bouton("./src/Images/Menu/bouton.PNG", "Passer son tour");
	    passerTour.addActionListener(new ActionListener() {			
			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				
			}
		});	    
	    Bouton sauvegarder = new Bouton("./src/Images/Menu/bouton.PNG", "Sauvegarder");
	    sauvegarder.addActionListener(new ActionListener() {			
			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				
			}
		});
	    Bouton charger = new Bouton("./src/Images/Menu/bouton.PNG", "Charger");
	    charger.addActionListener(new ActionListener() {			
			@Override
			public void actionPerformed(ActionEvent e) {
				// TODO Auto-generated method stub
				
			}
		});
	    Bouton quitter = new Bouton("./src/Images/Menu/bouton.PNG", "Quitter");
	    quitter.addActionListener(new ActionListener() {			
			@Override
			public void actionPerformed(ActionEvent e) {
				Controleur.Principale.Action.quitter();
			}
		});
	    action2.add(passerTour);
	    action2.add(sauvegarder);
	    action2.add(charger);
	    action2.add(quitter);
	    
	    action.add(action1);
		action.add(action2);
		
		this.add(perso, BorderLayout.WEST);
		this.add(action, BorderLayout.CENTER);
		this.add(chateau, BorderLayout.EAST);
	}
	
	
	


	@Override
	public void update(Observable o, Object arg) {
		// TODO Auto-generated method stub
		
	}	
	
}
